{template header_common}
<link rel="stylesheet" type="text/css" href="/static/css/goods.css">
<div class="area sitepath">
	<a href="/">首页</a> <i>&rsaquo;</i>
    {loop $pathlist $path}
    <a href="/?m=$G[m]&c=list&catid=$path[catid]">$path[cname]</a> <i>&rsaquo;</i> 
    {/loop}
    $goods[name]
</div>
<div class="area goodsDetail">
	<div class="picBox">
    	<div class="image">
        	{loop $piclist $pic}
            <img src="{echo image($pic[image]);}">
            {/loop}
        </div>
    </div>
    
    <div class="goodsInfo">
    	<h1 class="h1-title">$goods[name]</h1>
        <div class="goodsAttr">
        	<div class="price">
            	{if $goods[discount_price]}
            	<p class="p1">原价: <s>{echo @number_format($goods[price],2)}</s></p>
            	<p class="p2">折扣价: <strong>{echo @number_format($goods[discount_price],2)}</strong></p>
                {else}
                <p class="p2">价格: <strong>{echo @number_format($goods[price],2)}</strong></p>
                {/if}
            </div>
            <div class="discounting">正在促销 可返现80%</div>
            <form method="post" id="buyForm" action="/?m=$G[m]&c=buy">
            <input type="hidden" name="id" value="$id">
            <div class="attrbox">
                <div class="row">
                	<div class="name">送至</div>
                    <div class="con">贵州六盘水 金水港湾</div>
                </div>
                <div class="row">
                	<div class="name">颜色分类</div>
                    <div class="con">默认分类</div>
                </div>
                <div class="row">
                	<div class="name">特色服务</div>
                    <div class="con">七天无理由退货</div>
                </div>
                
                <div class="row">
                	<div class="name">购买数量</div>
                    <div class="con">
                    	<div class="changebtn" onclick="changeNumber(0)">-</div>
                        <input type="text" name="goods_number" id="goods_number" class="buynum" value="1">
                        <div class="changebtn" onclick="changeNumber(1)">+</div>
                    </div>
                </div>
            </div>
            </form>
            <div class="btn-container">
            	<a class="btn btn-buy" onclick="Buy($goods[id])">立即购买</a>
                <a class="btn btn-cart" onclick="addToCart($goods[id])">加入购物车</a>
                <a class="btn btn-phone" onclick="addToFavorite($goods[id])">加入收藏</a>
                <p class="p">商品数量有限，下单后需在30分钟内付款，否则无货哦。</p>
            </div>            
        </div>
        
        <!--<div class="shopbox">
        	<div class="con">
            	<h3>$shop[shopname]</h3>
            </div>
        </div>-->
    </div>
</div>
<div class="blank"></div>
<div class="area goodsdiv">
	<div class="bar">
    	<div class="tab tab-on">店家热卖</div>
        
    </div>
    
    <div class="hot-sale">
        <ul>
            {eval $goodslist=goods_get_list(0,6,0,'RAND()');}
            {loop $goodslist $id $list}
            <li><a href="/?m=goods&c=detail&id=$id"><img src="{echo image($list[thumb]);}"></a></li>
            {/loop}
        </ul>
    </div>
</div>

<div class="blank"></div>
<div class="area">
	<div class="goodsdiv">
    	<div class="bar">
            <div class="tab tab-on">商品详情</div>
            <div class="tab">评价(100)</div>
            <div class="tab">售后保障</div>
        </div>
        
        <div class="desc">$description[description]</div>
      <div class="desc" style="display:none;" id="goods-comment-div">
      		
      </div>
        <div class="desc shouhou" style="display:none;">
              <h2>72小时发货</h2>
              <p>付款后72小时内发货</p>
              <div class="blank"></div>
              <h2>7天无理由退货</h2>
              <p>该商品支持 7 天无理由退货，自商品签收之日起 7 天内：</p>
              <p>1、商品外包装完整，相关附（配）件齐全；（若有）要求吊牌完整；（若有）唯一性三包卡不能缺失或撕损；</p>
              <p>2、商品无显著穿戴、无洗涤、无破损等痕迹；如商品使用留下记录参数，则不支持退；</p>
              <p>3、限量版商品的退货条件以官网说明为准（是否限量以官网说明为准）；</p>
              <p>可申请无理由退货，包邮商品需要买家承担退货邮费，非包邮商品需要买家承担发货和退货邮费。</p>
        </div>
    </div>
</div>
<script type="text/javascript">
loadComment($id);
$(".tab").click(function(e) {
    $(this).addClass('tab-on').siblings().removeClass('tab-on');
	$(".desc").eq($(this).index()).show().siblings('.desc').hide();
});
function loadComment(id){
	$.ajax({
		url:'/?m=$G[m]&c=$G[c]&a=showcomment&dataid='+id,
		beforeSend: function(){
			$("#goods-comment-div").html('正在加载评论内容...');
		},
		success: function(c){
			$("#goods-comment-div").html(c);
		}	
	});
}
</script>
<script src="/static/js/goods_buy.js"></script>
{template footer_common}